package com.neucollege.system.service.impl;

import com.neucollege.system.domain.dto.SupervisorDTO;
import com.neucollege.system.domain.pojo.Supervisor;
import com.neucollege.system.mapper.SupervisorMapper;
import com.neucollege.system.result.Result;
import com.neucollege.system.service.NEPSService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class NEPSServiceImpl implements NEPSService {

    private final SupervisorMapper supervisorMapper;

    @Override
    public Result register(SupervisorDTO supervisorDTO) {
        Supervisor supervisor = new Supervisor();
        //TODO:MD5加密
        BeanUtils.copyProperties(supervisorDTO,supervisor);
        supervisorMapper.insert(supervisor);
        return Result.success();
    }
}
